﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Tron
{
    class BlockGraphics
    {

        public enum Styles
        {
            Solid,
            LightEdges,
            HeavyEdges,
            Explosion
        }

        Styles style;
        public Styles Style
        {
            get
            {
                return style;
            }
            set
            {
                style = value;
                switch (style)
                {
                    case Styles.Solid:
                        currentTexture = solidTexture;
                        break;
                    case Styles.LightEdges:
                        currentTexture = lightEdgesTexture;
                        break;
                    case Styles.HeavyEdges:
                        currentTexture = heavyEdgesTexture;
                        break;
                    case Styles.Explosion:
                        currentTexture = explosionTexture;
                        break;
                }
            }
        }

        Texture2D solidTexture;
        Texture2D lightEdgesTexture;
        Texture2D heavyEdgesTexture;
        Texture2D explosionTexture;

        Texture2D currentTexture;

        public Vector2 Position { get; set; }
        public Color Color { get; set; }

        public BlockGraphics(Game game, Vector2 position, Color color)
        {
            String prefix = "Textures\\Blocks\\";
            solidTexture = game.Content.Load<Texture2D>(prefix + "solid");
            lightEdgesTexture = game.Content.Load<Texture2D>(prefix + "lightEdges");
            heavyEdgesTexture = game.Content.Load<Texture2D>(prefix + "heavyEdges");
            explosionTexture = game.Content.Load<Texture2D>(prefix + "explosion");

            Style = Styles.LightEdges;
            Position = position;
            Color = color;
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(currentTexture, Position, Color);
        }
    }
}
